<extend name="Public/base"/>
<block name="body">
<style type="text/css">.file_sort{width:30px; height:10px!important; line-height:10px!important; margin:0px!important;}</style>
<div class="widget-box">
          <div class="widget-title"> <span class="icon"> <i class="icon-th"></i> </span>
            <h5>{$meta_title}</h5>
             <div class="buttons">
              <a class="btn"  href="{:U('AddField',array('modelId'=>I('modelId'),'isChannel'=>I('isChannel')))}">新增模型</a>          
             </div>
           </div>
          <div class="widget-content ">
          <form action="{:U('Sort')}" method="post">
            <table class="table table-bordered table-striped with-check">
                  <thead>
                    <tr>
                      <td>排序</td>
                      <td>字段名</td>
                      <td>别名</td>
                      <td>字段类型</td>
                      <td>主表</td>
                      <td>状态</td>
                      <td>操作</td>
                    </tr>
                  </thead>
              <tbody>
                 <volist name="list" id="vo">
                    <if condition="$vo['status'] eq 1">
                    <tr>
                      <td><input type="text" name="sort[{$vo.field_id}]" value="{$vo.sort}" class="file_sort" /></td>
                      <td>{$vo.field}</td>
                      <td>{$vo.name}</td>
                      <td>
                        <if condition="$vo['type'] eq editor">编辑器 
                          <elseif condition="$vo['type'] eq channel_id">栏目
                          <else />{:get_attribute_type($vo['type'])}
                        </if>
                      </td>
                      <td><if condition="$vo['issystem'] eq 1"><font color="blue">√</font><else /> <font color="red">╳</font></if></td>
                      <td><span class="badge badge-success">开启<span></td>
                      <td>
                      <a href="{:U('editField',array('id'=>$vo['field_id'],'modelId'=>$vo['model_id'],'isChannel'=>$vo['is_channel']))}">编辑</a>  |
                      <if condition="$vo['issystem'] eq 1"> <font color="#ddd">禁用</font><else/><a href="{:U('Status',array('fieldid'=>$vo['field_id'],'status'=>$vo['status'],issystem=>$vo['issystem']))}">禁用</a></if>
                      <if condition="$vo['issystem'] eq 2"><a href="{:U('delField',array('id'=>$vo['field_id']))}">删除</a></if>
                      </td>
                    </tr>
                    </if> 
                 </volist>
                   <volist name="list" id="vo">
                    <if condition="$vo['status'] eq 0">
                      <tr>
                      <td><input type="text" name="sort[{$vo.field_id}]" value="{$vo.sort}" class="file_sort"  /></td>
                      <td>{$vo.field}</td>
                      <td>{$vo.name}</td>
                      <td>
                        <if condition="$vo['type'] eq editor">编辑器 
                          <elseif condition="$vo['type'] eq channel_id">栏目
                          <else />{:get_attribute_type($vo['type'])}
                        </if>
                      </td>
                      <td><if condition="$vo['issystem'] eq 1"><font color="blue">√</font><else /> <font color="red">╳</font></if></td>
                      <td><span class="badge">关闭<span></td>
                      <td><a href="{:U('editField',array('id'=>$vo['field_id']))}">编辑</a> | <a href="{:U('Status',array('fieldid'=>$vo['field_id'],'status'=>$vo['status'],issystem=>$vo['issystem']))}">启用</a></td>
                      <if condition="$vo['issystem'] eq 2"><a href="{:U('delField',array('id'=>$vo['field_id']))}">删除</a></if>
                    </tr>
                    </if> 
                 </volist>
              </tbody>
            </table>
            <div class="form-actions">
              <button class="btn btn-success" type="submit">排序</button>
            </div>
            </form>
          </div>
        </div>
</block>